package pack0618;

public class DemoF {
    public static void main(String[] args) {
        for (int i=7; ;i=i+7){
            if (i%3==2 && i%4==3 && i%5==4){
                System.out.println(i);
                break;
            }
        }
    }
}